<%--
  Created by IntelliJ IDEA.
  User: SXLWTT
  Date: 2021/11/4
  Time: 15:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="/js/jquery-1.9.1.min.js"></script>
    <script src="/js/fileupload.js"></script>
    <link rel="stylesheet" href="/css/img.css">
</head>
<body>
<form>
    收货单号:<input type="text" name="rodd"><br><br>
    收货日期:<input type="date" name="rdate"><br><br>
    优先级:
    <select name="priorty">
        <option value="">情选择</option>
        <option value="1">1</option>
        <option value="2">2</option>
        <option value="3">3</option>
    </select>
    状态:
    <select name="flag">
        <option value="">情选择</option>
        <option value="执行中">执行中</option>
        <option value="已完成">已完成</option>
        <option value="计划中">计划中</option>
        <option value="已取消">已取消</option>
    </select>

   <br><br>
    递送条款:<input type="text" name="terms"><br>
    制单人:
    <select name="zid">
        <option value="">情选择</option>
    </select>
   <br>
    制单时间:<input type="date" name="zdate"><br>

    客户:<input type="text" name="kname"><<br>
    附件图片:
    <div class="photoUpLoad" >
        <input type="file"   class="photo" name="photo" accept="image/*"><span class="cross">+</span>
        <img src="" alt="" class="photoEcho">
    </div>
    <br>
    总重量:<input type="text" name="total"><br>
    客户发货单列表:<input type="text" name="clist"><br>
    备注:
    <textarea name="remark"></textarea>
   <br>


    <input type="button" value="注册" onclick="add()">
</form>
</body>
</html>
<script>

    $.ajax({
        url:"listZmark.do",
        type:"post",
        dataType:"json",
        success:function (obj) {
            for (var i in obj){
                $("[name='zid']").append("<option value='"+obj[i].zid+"'>"+obj[i].zid+"+"+obj[i].zname+"</option>")
            }
        }
    })
    function add() {


        var formData = new FormData($("form")[0]);
        $.ajax({
            url:"addGly.do",
            data:formData,
            type:"post",
            dataType:"json",
            success:function (obj){
                if (obj>0){
                    alert("添加成功")
                    location="list.do"
                }
            },processData:false,
            contentType:false
        })
    }
</script>
